<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-08-17
    	描述：合同信息
    -->
	<div class="Announcements">
		<div class="Website-visits">
			<div class="location">
				<div class="location-text fl">
					<img class="location-img fl" src="../../images/ProjectManager/projectApply.png" />
					<p class="fr">项目申请</p>
				</div>
				<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
			</div>
			<div class="search-box">
				<div class="fl">
					<label>项目名称：</label>
          <input name="search" class="search" type="text" autocomplete="off" v-model="search" />
          <input class="btn" type="button" value="搜索" @click="searchTodo" />
				</div>
			</div>
			<div class="PressRelease-list">
				<table>
					<thead>
						<tr>
							<th class="table-text-th1">项目名称</th>
							<th class="table-text-th1">发布基地</th>
							<th class="table-text-th1">发布时间</th>
							<th class="table-text-th1">项目类型</th>
							<th class="table-text-th1">项目详情</th>
							<th class="table-text-th1">已申请人数</th>
							<th class="table-text-th1">申请状态</th>
              <th class="table-text-th1">项目状态</th>
              <th class="table-text-th1">操作</th>
            </tr>
					</thead>
					<tbody>
            <tr v-if="projectList.length == 0">
              <td colspan="9" class="center">暂无数据！</td>
            </tr>
            <tr v-for="project in projectList">
							<td :title="project.name"><span class="show-oneline-table">{{project.name}}</span></td>
							<td :title="project.areasName"><span class="show-oneline-table">{{project.areasName}}</span></td>
							<td>{{formatData(project.releaseTime)}}</td>
							<td>{{project.type == 1 ? "横向项目" : "研究院项目"}}</td>
							<td><input type="button" value="查看" class="delete write" @click="showProjectDetailsModel(project.id)"/></td>
							<td>{{project.applicationCount}}</td>
              <td>{{auditStatus(project.applicationStatus,project.applicationAuditStatus)}}</td>
              <td>{{project.areasStatus == 6 || project.areasStatus == 3 ? "无效" : "有效"}}</td>
							<td>
                <input @click="showProjectApplication(project.id)" type="button" value="申请" class="delete write" v-if="project.applicationStatus == 0 && (project.areasStatus == 6 || project.areasStatus == 3 ? false : true)"/>
                <input type="button" value="查看申请书" class="delete write" @click="preview(project.applicationBookUrl)" v-else-if="project.applicationStatus == 1"/>
              </td>
							<!--<td><input @click="projectDetails" type="button" value="编写" class="delete" /></td>-->
						</tr>
					</tbody>
				</table>
				<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
				<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
			</div>
		</div>

		<!-- 项目申请-模态框-->
		<div v-show="ProjectModelShow" class="tenant-model">
			<div class="tenant-model-content demandModel">
				<header class="tenant-model-header">
					<h3>申请项目</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<form class="form-box" id="projectApplicationForm">
							<input type="hidden" name="expertId" v-model="projectApplication.expertId" />
							<input type="hidden" name="projectId" v-model="projectApplication.projectId" />
							<div class="form-line">
								<label>申请人：</label>
								<div class="input-box">
									{{expertInfo.expertName}}
									<!--<input type="text" :value="expertInfo.expertName" readonly>-->
								</div>
							</div>
							<div class="form-line">
								<label>二级学科：</label>
								<div class="input-box">
									{{expertInfo.secondLevel}}
									<!--<input type="text" :value="expertInfo.secondLevel" readonly>-->
								</div>
							</div>
							<div class="form-line">
								<label>身份证号：</label>
								<div class="input-box">
									{{expertInfo.theWork}}
									<!--<input type="text" :value="expertInfo.theWork" readonly>-->
								</div>
							</div>
							<div class="form-line">
								项目申请书模板：<a @click="download()" class="discoloration delete write">下载</a>
							</div>
							<div class="form-line imgbox">
								<label><span class="star">*</span>附件上传：</label>
								<input type="hidden" name="applicationBookUrl" v-model="projectApplication.applicationBookUrl" />
								<input type="file" id="handIdFront" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*" @change="idFrontImg($event)" style="display: none;" />
								<input type="button" value="上传附件" class="delete write" @click="touchOffIdInput(1)" />
								<input type="button" value="删除附件" class="delete write" @click="deleteEnclosure()"  v-if="FileUpload.length"/>
								<ul class="img-box" v-if="FileUpload.length">
									<li v-for="item in FileUpload">{{item}}</li>
								</ul>
							</div>
							<input type="reset" style="display: none" />
						</form>
					</div>
				</div>
				<footer class="tenant-model-footer">
					<button class="determine" @click="applicationProject">提交申请</button>
				</footer>
			</div>
		</div>

		<!-- 审核未通过-模态框-->
		<div v-if="WorkModelShow" class="tenant-model">
			<div class="tenant-model-content WorkModelShow">
				<header class="tenant-model-header">
					<h3>审核未通过</h3>
					<span @click="closeModels" id="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<div class="rork-ecord">
							<p>二级学科不符</p>
							<p>附件：<span class="attachment">项目申请驳回书</span></p>
						</div>
					</div>
				</div>
			</div>
		</div>

    <!-- 项目详情-模态框-->
    <div v-if="projectDetailsModelShow" class="tenant-model">
      <div class="tenant-model-content">
        <header class="tenant-model-header">
          <h3>查看项目详情</h3>
          <span @click="closeModel" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body look-detail">
          <div class="search-contain">
            <!--模态框内容板块-->
            <div class="rork">
              <div>基地名称：<p>{{project.areasName}}</p></div>
              <div>项目名称：<p>{{project.name}}</p></div>
              <div>项目类型：{{project.type == 1 ? "横向项目" : "研究院项目"}}</div>
              <div>项目简介：<p>{{project.introduction}}</p></div>
              <div>项目需求说明书：<a @click="preview(project.demandBookUrl)" class="discoloration">预览</a></div>
            </div>
          </div>
        </div>
        <!--<footer class="tenant-model-footer">
          <button class="determine" @click="closeModel">返回</button>
        </footer>-->
      </div>
    </div>
	</div>

</template>
<script src="./ProjectApplication.js"></script>

<style scoped>
	@import "ProjectApplication.css"
</style>
